use EntityManagerTestHelper;
use EntityManager;


$mgr = EntityManager->new();

testClass($mgr, "EntityManager");

testEntityManagerFields($mgr);

$entityClass = "Entity";
print "\n";
print "\n";
testEntitySpawn($mgr, $entityClass);

$entityClass = "Entity";
$catName = "CATTEST";
print "\n";
print "\n";
testSpawnIntoCategory($mgr, $entityClass, $catName);

print "\n";
print "\n";
testEntitySpawnNoRegister($mgr, $entityClass);

print "\n";
print "\n";
$entity = Entity->spawn();
testRegisterToNoCat($mgr, $entity);

print "\n";
print "\n";
testRemove($mgr, $entity);

print "\n";
print "\n";
$entity = Entity->spawn();
$catName = "TESTCATEGORY";
testRegisterToCategory($mgr, $entity, $catName);


print "\n";
print "\n";
$mgr = EntityManager->new();
@entitiesA = (Entity->spawn(), Entity->spawn(), Entity->spawn());
@entitiesB = (Entity->spawn(), Entity->spawn(), Entity->spawn());
$bCatName = "B";
foreach(@entitiesA){
    $mgr->registerEntity($_);
}

foreach(@entitiesB){
    $mgr->registerEntity($_, $bCatName);
}

@all = (@entitiesA, @entitiesB);
testFullEntityList($mgr, \@all);
testCategoryEntityList($mgr, $bCatName, \@entitiesB);

1;
